import java.util.LinkedList;


public class OddList {

	protected int occurance;
	protected LinkedList<Ball> balls;
	
	public OddList(int i)
	{
		occurance = i;
		balls = new LinkedList<Ball>();
	}
	
	public void setOccurance(int i)
	{
		occurance = i;
	}
	
	public int getOccurance()
	{
		return occurance;
	}
	
	public LinkedList<Ball> getBalls()
	{
		return balls;
	}
	
	public void addBall(Ball b)
	{
		if(balls.size() == 0) //if size of the list is 0
		{
			balls.add(b);
		}
		else
		{
			int temp = -1;
			for(int i = 0; i < balls.size(); i++)
			{
				if(b.getOdd() <= balls.get(i).getOdd())
				{
					temp = i;
					break;
				}
			}
			
			if(temp == -1)
			{
				temp = balls.size();
			}
			balls.add(temp, b);
		}
	}
}
